import { defHttp } from "@/utils/http";

// ERP 费用类型 VO
export interface ExpenseTypeVO {
	id: number; // 主键
	name: string; // 名称
	sqNumb: number; // 序号
	parentId: number; // 父级ID
}

// ERP 费用类型 API
export const ExpenseTypeApi = {
	// 查询费用类型分页
	getExpenseTypePage: async (params: any) => {
		return await defHttp.get({ url: `/whs/cat-admin-fees/page`, params });
	},

	// 查询费用类型详情
	getExpenseType: async (id: number) => {
		return await defHttp.get({ url: `/whs/cat-admin-fees/get?id=` + id });
	},

	// 新增费用类型
	createExpenseType: async (data: ExpenseTypeVO) => {
		return await defHttp.post({ url: `/whs/cat-admin-fees/create`, data });
	},

	// 修改费用类型
	updateExpenseType: async (data: ExpenseTypeVO) => {
		return await defHttp.put({ url: `/whs/cat-admin-fees/update`, data });
	},

	// 删除费用类型
	deleteExpenseType: async (id: number) => {
		return await defHttp.delete({
			url: `/whs/cat-admin-fees/delete?id=` + id
		});
	},

	// 导出费用类型 Excel
	exportExpenseType: async (params: any) => {
		return await defHttp.download({ url: `/whs/cat-admin-fees/export-excel`, params });
	}
};
